[MIGRATE] Fix edge case errors for get-discovered-server command#9523
[MIGRATE] Fix edge case errors for get-discovered-server command#9523necusjz merged 100 commits intoAzure:mainfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| migrate local replication list | cmd migrate local replication list update parameter project_name: removed property id_part=name |
|
Hi @saifaldin14, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
There was a problem hiding this comment.
Pull request overview
This PR fixes edge case errors in the az migrate get-discovered-server command by improving handling of different API response formats and machine identification patterns.
Changes:
- Updated source machine name field to use
sourceVmNameinstead ofsourceMachineNamein protected item formatting - Added support for extracting machine names from full resource IDs
- Enhanced server data handling to support both list and single-item API responses
- Extended filtering and extraction logic to handle different API endpoint formats (Microsoft.Migrate vs Microsoft.OffAzure)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/migrate/azext_migrate/helpers/replication/list/_execute_list.py | Changed to use sourceVmName field from API response for source machine name |
| src/migrate/azext_migrate/helpers/_server.py | Added resource ID parsing, enhanced response handling for single items vs lists, and improved data extraction for different API formats |
| src/migrate/azext_migrate/custom.py | Integrated machine name extraction and removed OData filter (moved to client-side filtering) |
|
[Release] Update index.json for extension [ migrate-3.0.0b3 ] : https://dev.azure.com/msazure/One/_build/results?buildId=149279443&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az migrate get-discovered-server
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.